home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Sound
/
MrMPEG
/
Insert.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-11-23
|
2KB
|
56 lines
/* Insert.rexx */
options results; address MrMPEG
MUIA_List_Active = 0x8042391c; MUIA_List_Entries = 0x80421654
MUIA_ShowMe = 0x80429ba8; MUIV_List_Active_Top = -2
list ID SLIST ATTRS MUIA_List_Entries; entries = result
popasl ID FPATH; fpath = result
temp_name = TmpFile('PIPE:MPEG_List.')
address command 'RequestFile >'temp_name 'DRAWER' fpath 'PATTERN "#?.(mp1|mp2|mp3)"
TITLE "Select MPEG files" MULTISELECT NOICONS'
if open('SongList', temp_name, 'r') = 1 then do
temp_list = readln('SongList')
call close('SongList')
if temp_list ~= "" then do
do forever
parse var temp_list '"' first '"' temp_list
if first == '' then leave
if exists(first) then do
popasl ID PATH; pathname = result
temp_name = TmpFile('PIPE:MPEG_Temp.')
address command pathname'MPEGA -h' first '>'temp_name
if open('Output', temp_name, 'r') = 1 then do /* Check if it can read song info or not */
null = readln('Output')
null = readln('Output')
null = readln('Output')
null = readln('Output')
info = readln('Output')
length = readln('Output')
call close('Output')
if info ~= "" then do
parse var info dummy':' '
'detail'
'
parse var length dummy':' '
'temp_total_time'
'
list ID SLIST ATTRS MUIA_List_Active
list ID SLIST INSERT NODUP POS result + 1,
STRING first","temp_total_time","strip(detail)
end /* of if info */
else request ID WARN GADGETS '"OK"' '"Could not find selected file."'
end /* of if open */
else request ID WARN GADGETS '"OK"' '"Could not open a pipe."'
end /* of if exists */
else do
temp_string = "Could not open the file '"first"'."
request ID WARN GADGETS '"OK"' temp_string
end
end /* of do forever */
list ID SLIST ATTRS MUIA_List_Entries; temp_max = result
setvar max temp_max
text ID MAX LABEL "\033b\033r"temp_max
if entries = 0 then list ID SLIST ATTRS MUIA_List_Active MUIV_List_Active_Top
end /* of if temp_list */
end /* of if open */
else request ID WARN GADGETS '"OK"' '"Could not open a pipe."'
return